home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20041116-20060924
/
000172_fdc@columbia.edu_Mon Oct 17 15:31:11 2005.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Path: newsmaster.cc.columbia.edu!not-for-mail
From: Frank da Cruz <fdc@columbia.edu>
Newsgroups: comp.protocols.kermit.misc
Subject: Re: set timeout for HTTP transfers?
Date: 17 Oct 2005 19:09:21 GMT
Organization: Columbia University
Lines: 38
Message-ID: <slrndl7tn1.g88.fdc@sesame.cc.columbia.edu>
References: <1129528599.691472.17580@g44g2000cwa.googlegroups.com>
Reply-To: fdc@columbia.edu
NNTP-Posting-Host: sesame.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1129576161 10756 128.59.59.56 (17 Oct 2005 19:09:21 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 17 Oct 2005 19:09:21 GMT
User-Agent: slrn/0.9.8.0 (SunOS)
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:15415
On 2005-10-17, tomviolin <rock_spambust_violin@yahoo.com> wrote:
: I have a Kermit data collection script that, among other things,
: retrieves a file via HTTP. I am having trouble with the HTTP GET
: command failing with a timeout every once in a while.
:
: The data I'm getting from the HTTP server isn't critical and so I'd
: like to set a short timeout on the HTTP GET operation so my whole data
: collection operation doesn't get held up waiting.
:
: How does one set the timeout for the HTTP GET operation?
:
Right now, there's no way. Ditto for FTP, which has also been mentioned
several times in this connection. It's easy enough (if rather tedious)
to add alarm()/signal()/setjmp()/longjmp() for Unix, but it's not
portable to the non-Unix platforms where the C-Kermit code must also run.
Unlike most other non-portable constructions, the Unix alarm mechanism is
structural. And it has to be added to each and every place where we are
doing network i/o for HTTP (or FTP). In the case of HTTP, this would be
in ckcnet.c, routines http_connect(), http_open(), http_close(), http_inc(),
http_ttol(), http_get(), http_head(), etc etc, a big mess. Similarly for
FTP. It's not impossible but it's a lot of work and a lot of risk for
not a lot of gain compared with some other items on the to-do list.
Another approach might be to add a generalized timer and trap feature to
the Kermit command language, and then users could put timeouts around
anything they wanted:
set timer 5
http /array:&a get http://www.blah.com/index.html
.http_status := \v(status)
clear timer
if (\m(http_status)) ...
The problem there is, how does Kermit know what was going on that needs
to be cleaned up if the timer goes off? Open connections and whatnot.
Maybe it doesn't matter, maybe it's worth looking into.
- Frank